package com.lxb.blog.web;

import com.lxb.blog.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/archives")
public class ArchivesShowController {

    @Autowired
    private BlogService blogService;

    @GetMapping
    public  String Archivesshow(Model model, Pageable pageable){

        model.addAttribute("page",blogService.listBlog(pageable));
        return "archives";
    }
}
